package com.xuantu.pattern.create.singleton;

/**
 * 懒汉模式升级版
 * 线程安全
 * @author fengzp
 *
 */
public class DoubleCheckSingleton extends BaseSingleton {

	private static volatile DoubleCheckSingleton instance;
	
	private DoubleCheckSingleton() {}
	
	public static DoubleCheckSingleton getInstance() {
		if (null == instance) {
			synchronized(LazySingleton.class) {
				if (null == instance) {
					instance = new DoubleCheckSingleton();
				}
			}
		}
		
		return instance;
	}
	 
}
